package edu.algorithm.knn.parallel.common;

import edu.algorithm.knn.parallel.DataSupport;

public class DataPoint extends DataSupport {
	
	private float[] datas;
	
//	private float distance;
	
	private DataPoint(int label,float[] datas) {
		
		super(label);
		this.datas = datas;
	}
	
	public float[] getDatas(){
		
		return datas;
	}
	
//	public float getDistance(){
//		return distance;
//	}
//	
//	public void setDistance(float distance){
//		this.distance = distance;
//	}
	public static DataPoint getOnePoint(String oneline, String lable){
		
		String[] sdatas = oneline.split(",");
		float[] fdatas = new float[sdatas.length];
		for(int i = 0;i<sdatas.length;i++){
			fdatas[i] = Float.valueOf(sdatas[i]);
		}
		return new DataPoint(Integer.valueOf(lable), fdatas);
	
	}
}
